package com.aishua.fire.jpa;


import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.aishua.fire.jpa.entity.RequestLog;

import java.lang.Long;

import javax.transaction.Transactional;

/**
 * jpa使用
 * @author Administrator
 *
 */
public interface RequestLogDao extends JpaRepository<RequestLog, Long>,JpaSpecificationExecutor<RequestLog> {

	@Transactional
	@Modifying
	@Query(value="delete from RequestLog t WHERE DATEDIFF(t.createDate, NOW()) > 30 ")
	void deleteOneMonthBefore();
	
}
